package com.itheima.mArray;

/*
  股票年增减
 */
public class ArrayDemo06 {
    public static void main(String[] args) {
        //建立录入数组
        double[] arr = {10.4, -3, -6.2, 1.2, -6.1, -19, -3.8, 0.9, -4.5, 5.5};
        int count1 = 0;
        int count2 = 0;
        //遍历进行比较
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > 0) {
                count1++;
            } else {
                count2++;
            }
        }
        System.out.println("赚钱的股票一共有:" + count1 + "只");
        System.out.println("赔钱的股票一共有:" + count2 + "只");
    }
}
